import React from 'react';
const obj = {x:1}
console.log(Object.getOwnPropertyDescriptor(obj,"x"),'对象描述');



export const DefinePropertyCom = function () {


    // const loggerTime = (target,name,descriptor)=>{
    //     let now = Date.now();
    //     descriptor.value = function proxy(){
    //         console.log('距离上次修改已过:',Date.now() - now);
    //     }
    // }

    const ReadOnly = (target:any,name:string)=>{
        //ts中装饰器只有两个参数
        console.log(target,name);
    }


    class Demo{

        @ReadOnly
        num=1;

        // @loggerTime
        time(){

        }
    }
    new Demo().num=3;

    return (
        <>
            ddd
        </>
    )

};